<template>
  <div class="app-container">
    <n-alert title="打开指定应用" type="success">
      演示窗口通信，创建自由窗口，用于一些一次性的窗口展示，无延迟展示
    </n-alert>
    <n-flex style="margin-top: 16px;">
      <n-button @click="handleCreate(1)">自由窗口，条件1</n-button>
      <n-button @click="handleCreate(2)">自由窗口，条件2</n-button>
    </n-flex>
  </div>
</template>

<script setup>
import { emit } from "@tauri-apps/api/event";

const handleCreate = (type) => {
  if(type === 1) {
    emit('show-free-window', {
      type: 'free-window-test',
      position: [200, 500],
      size: [400, 300]
    })
  } else {
    emit('show-free-window', {
      type: 'free-window-test条件2的参数',
      position: [800, 200],
      size: [600, 400],
      params: {
        content: '自定义拉拉'
      }
    })
  }
}
</script>

<style scoped>

</style>
